import { status } from '@/plugins/mate.js'
export const formConfig = [
    {
        name: 'device_name',
        type: 'input',
        placeholder: '设备名称',
    },
    {
        name: 'scope_id_list',
        type: 'cascader',
        placeholder: '筛选范围',
        options: [],
    },
    {
        name: 'start_time',
        type: 'date',
        placeholder: '开始时间',
    },
    {
        name: 'end_time',
        type: 'date',
        placeholder: '结束时间',
    },
    {
        name: 'maker',
        type: 'input',
        placeholder: '编制人',
    },
    {
        name: 'type',
        type: 'select',
        placeholder: '报告类型',
        options: [
            { label: '人工上传', value: 1 },
            { label: '系统生成', value: 2 },
            { label: '全部', value: '' },
        ],
    },
    {
        name: 'status',
        type: 'select',
        placeholder: '报告状态',
        options: status.options,
    },
]

export const config = [
    {
        name: 'title',
        type: 'input',
        label: '标题',
        placeholder: '请输入标题',
        required: true,
    },
    {
        name: 'maker',
        type: 'input',
        label: '编制人',
        placeholder: '请输入编制人',
    },
    {
        name: 'result',
        type: 'input',
        label: '诊断结论',
        placeholder: '请输入诊断结论',
    },
    {
        name: 'status',
        type: 'select',
        label: '报告状态',
        placeholder: '请选择报告状态',
        options: [
            { label: '编辑中', value: '0' },
            { label: '已完成', value: '1' },
        ],
    },
    {
        name: 'scope_id_list',
        type: 'cascader',
        label: '报告路径',
        placeholder: '请选择报告路径',
        options: [],
    },
    {
        name: 'device_id',
        type: 'select',
        label: '设备',
        placeholder: '请选择设备',
        options: [],
    },
    {
        name: 'filepath',
        type: 'file',
        label: '附件',
        action: '/api/report/upload',
        accept: '.pdf',
    },
]

export const column = [
    {
        name: 'selection',
    },
    {
        label: '标题',
        name: 'title',
    },
    {
        label: '编制人',
        name: 'maker',
    },
    {
        label: '诊断结论',
        name: 'result',
    },
    {
        label: '报告状态',
        name: 'status',
        format: (val) => status.dirc[val],
    },
    {
        label: '创建时间',
        name: 'create_time',
        width: '220',
    },
    {
        label: '附件',
        name: 'filepath',
        accept: '.pdf',
    },
    {
        title: '操作',
        name: 'action',
        width: '220',
        buttons: [
            {
                text: '下载',
                click: (val) => {},
            },
            {
                text: '编辑',
                click: (val) => {},
            },
            {
                text: '删除',
                click: (val) => {},
            },
        ],
    },
]
